package com.ruoyi.system.service.impl;

import com.ruoyi.common.core.domain.entity.Energy;
import com.ruoyi.system.mapper.EnergyMapper;
import com.ruoyi.system.service.EnergyService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @Author: ruohao
 * @Date: 2023/9/14
 **/
@Service
public class EnergyServiceImpl implements EnergyService {
    @Resource
    private EnergyMapper energyMapper;

    @Override
    public List<Energy> selectList(Energy energy) {
        return energyMapper.selectList(energy);
    }

    @Override
    public Energy selectById(Long id) {
        return energyMapper.selectById(id);
    }

    @Override
    public Boolean create(Energy energy) {
        return energyMapper.insert(energy) == 1;
    }

    @Override
    public Boolean update(Energy energy) {
        return energyMapper.update(energy) == 1;
    }

    @Override
    public Boolean deleteById(Long id) {
        return energyMapper.deleteById(id) == 1;
    }

    @Override
    public List<Energy> selectFiveList() {
        return energyMapper.selectFiveList();
    }

    /**
     * 批量删除【请填写功能名称】
     *
     * @param ids 需要删除的【请填写功能名称】主键
     * @return 结果
     */
    @Override
    public int deleteEnergyByIds(Long[] ids)
    {
        return energyMapper.deleteEnergyByIds(ids);
    }
}
